﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<% 
    BIZ.WebInfomationPublishOper ipo = new BIZ.WebInfomationPublishOper();
    string pid = Request.QueryString["pid"] == null ? ((int)DAL.webEnums.template.新闻中心_行业动态).ToString() : Request.QueryString["pid"].ToString();
    
    int pageno = Request["pageno"] == null ? 1 : int.Parse(Request["pageno"].ToString());//当前页
    int pagesize = 15;//单页记录数
    int count = 0;//总记录数
    int pageNumber = 0;//总页数
    IList ligg = ipo.getlistweb(pageno, pagesize,int.Parse(pid));
    string para = HttpContext.Current.Request.Url.Query;
%>
<div class="main w_980 clearfix">
	<!--left-->
    <div class="left_box">
    	<!--menu-->
        <div class="menu">
        	<h2><img src="../../images/ico_11.png" /><strong><span>新闻中心</span></strong></h2>
            <ul>
                <%
                    Response.Write("<li><a href=\"xwzx.html?pid=" + (int)DAL.webEnums.template.新闻中心_行业动态 + "\" class=\"" + (pid == ((int)DAL.webEnums.template.新闻中心_行业动态).ToString() ? "s" : "") + "\">行业动态</a></li>");
                    Response.Write("<li><a href=\"xwzx.html?pid=" + (int)DAL.webEnums.template.新闻中心_学校新闻 + "\" class=\"" + (pid == ((int)DAL.webEnums.template.新闻中心_学校新闻).ToString() ? "s" : "") + "\">学校新闻</a></li>");
                    Response.Write("<li><a href=\"xwzx.html?pid=" + (int)DAL.webEnums.template.新闻中心_学校活动 + "\" class=\"" + (pid == ((int)DAL.webEnums.template.新闻中心_学校活动).ToString() ? "s" : "") + "\">学校活动</a></li>");
                    Response.Write("<li><a href=\"xwzx.html?pid=" + (int)DAL.webEnums.template.新闻中心_学校公告 + "\" class=\"" + (pid == ((int)DAL.webEnums.template.新闻中心_学校公告).ToString() ? "s" : "") + "\">学校公告</a></li>");
                %>
            </ul>
        </div>
        <!--联系方式-->
        <% 
            Html.RenderPartial("~/Views/Shared/lxfs.ascx"); 
        %>
    </div>
	<!--right-->
    <div class="right_box">
    	<!--title-->
    	<div class="title_box"><strong><%=Enum.GetName(typeof(DAL.webEnums.template), int.Parse(pid)).Replace("新闻中心_", "")%></strong><span>·<a href="/index.html">首页</a>&gt;<a href="xwzx.html">新闻中心</a>&gt;<a href="xwzx.html?pid=<%=pid %>"><%=Enum.GetName(typeof(DAL.webEnums.template), int.Parse(pid)).Replace("新闻中心_", "")%></a></span></div>
        <!--news list-->
        <div class="news_list_box">
        	<ul class="news_list_ul">
            	
                <% 
                foreach (Hashtable tb in ligg)
                {
                    if (tb["total"] == null)
                    {
                        Response.Write("<li><a target=\"_blank\" href=\"/template/xwdetail.html?pid=" + pid + "&id=" + tb["Wi_id"] + "\">·" + (tb["Wi_title0"] == null ? "" : tb["Wi_title0"].ToString()) + "</a><span>[" + DateTime.Parse(tb["Wi_addTime"].ToString()).ToString("yyyy-MM-dd") + "]</span></li>");
                    }
                    else
                        count = (tb["total"] == null ? 0 : int.Parse(tb["total"].ToString()));
                }
                %>

            </ul>
            <!--pager-->
            <div class="pager">
                <%
                    pageNumber = ((count % pagesize) == 0 ? (count / pagesize) : ((count / pagesize) + 1));
                    int start = pagesize * (pageno - 1) + 1;
                    if (start < 0)
                        start = 0;
                    int end = (start + pagesize-1);
                    if (pageno == pageNumber)
                    {
                        if ((count % pagesize) != 0)
                        {
                            end = (start + (count % pagesize) - 1);
                        }
                    }
                %>
                <p class="left"><%=count%> 条记录，显示第 <%=start %> 条 - 第 <%=end %> 条记录</p>
                <p class="right"><a href="<%=Request.RawUrl %><%=para==""?"?":"&" %>pageno=1" title="首页" class="a1 a1_n"></a>
                <a href="<%=Request.RawUrl %><%=para==""?"?":"&" %>pageno=<%=(pageno==1?1:pageno-1) %>" title="上一页" class="a2"></a><span>第<b><%=pageno %></b>页/共 <%=pageNumber %> 页</span>
                <a href="<%=Request.RawUrl %><%=para==""?"?":"&" %>pageno=<%=(pageno==pageNumber?pageNumber:pageno+1) %>" title="下一页" class="a3"></a><a href="<%=Request.RawUrl %><%=para==""?"?":"&" %>pageno=<%=pageNumber %>" title="末页" class="a4"></a>
                <select id="sPage">
                <% 
                    for (int k = 1; k <= pageNumber;k++ )
                        Response.Write("<option value=\"" + k.ToString() + "\">" + k.ToString() + "</option>");
                %>
                </select></p>
                <script type="text/javascript" language="javascript">
                    $(function () {
                        $("#sPage").val(<%=pageno %>);
                        $("#sPage").change(function () {
                            window.location.href = "/template/xwzx.html?pageno=" + $("#sPage").val();
                        });
                    })
                </script>
            </div>
        </div>
    </div>
</div>

</asp:Content>
